#ifndef ENCRYPTORSALSA20_H
#define ENCRYPTORSALSA20_H

#include <QtCore>

#include "crypto/ciphers/encryptor.h"

struct salsa20_ctx;

class EncryptorSalsa20 : public Encryptor
{
public:
	EncryptorSalsa20(QByteArray key, QByteArray iv = QByteArray());
	virtual ~EncryptorSalsa20();

	virtual qint64 blockSize() const;
	virtual qint64 keySize() const;
	virtual QString getAlgorithmName() const;

	virtual void encrypt(const QByteArray &clearText, QByteArray &cipherText);

	virtual void decrypt(const QByteArray &cipherText, QByteArray &clearText);

	virtual bool toStream(QDataStream &);
	virtual bool fromStream(QDataStream &);

private:
	struct salsa20_ctx *ctx;
	QByteArray key;
	QByteArray iv;
};

#endif // ENCRYPTORSALSA20_H
